﻿using EternalRoad.Components;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace EternalRoad
{
    /// <summary>
    /// This is the main type for your game.
    /// </summary>
    public class EternalRoadGame : Game
    {
        #region Globals
        GraphicsDeviceManager graphics;
        /********************************/
        #region Components
        InputComponent inputComponent;
        WorldComponent worldComponent;
        CameraComponent cameraComponent;
        //***RenderComponent renderComponent;
        Renderer renderer;
        #endregion
        #endregion

        public EternalRoadGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            /**************************************************************************/
            inputComponent = new InputComponent(this);
            inputComponent.UpdateOrder = 1;
            Components.Add(inputComponent);

            worldComponent = new WorldComponent(this);
            worldComponent.UpdateOrder = 2;
            Components.Add(worldComponent);

            cameraComponent = new CameraComponent(this, worldComponent, inputComponent);
            cameraComponent.UpdateOrder = 3;
            Components.Add(cameraComponent);

            renderer = new Renderer(this, worldComponent, cameraComponent);
            renderer.UpdateOrder = 4;
            Components.Add(renderer);

            //***renderComponent = new RenderComponent(this, worldComponent, cameraComponent);
            //***renderComponent.UpdateOrder = 4;
            //***Components.Add(renderComponent);
            /**************************************************************************/
        }
    }
}
